home *** CD-ROM | disk | FTP | other *** search
- property pHiliterSprite, pBackgroundSprite, pHeadingSprite, pTextListSprite, pPhoneDisplaySprite, pArrowSprite, pArrowRollSprite
- global gScript, gVoid
-
- on initWorldMap
- set gScript to script "mapScript"
- set the pHiliterSprite of gScript to 10
- set the pBackgroundSprite of gScript to 11
- set the pHeadingSprite of gScript to 12
- set the pTextListSprite of gScript to 13
- set the pPhoneDisplaySprite of gScript to 14
- set the pArrowSprite of gScript to 16
- set the pArrowRollSprite of gScript to 15
- set the visible of sprite the pHiliterSprite of gScript to 0
- set the visible of sprite the pBackgroundSprite of gScript to 0
- set the visible of sprite the pTextListSprite of gScript to 0
- set the visible of sprite the pHeadingSprite of gScript to 0
- set the visible of sprite the pPhoneDisplaySprite of gScript to 0
- set the visible of sprite the pArrowSprite of gScript to 0
- set the visible of sprite the pArrowRollSprite of gScript to 0
- go("worldMap")
- puppetAllSprites(1)
- end
-
- on closeWorldMap
- puppetAllSprites(0)
- repeat with i = 1 to count(gScript)
- setaProp(gScript, getPropAt(gScript, i), gVoid)
- end repeat
- set gScript to gVoid
- end
-
- on clickedAContintent myContinentCode
- set the visible of sprite the pPhoneDisplaySprite of gScript to 0
- set the visible of sprite the pArrowSprite of gScript to 0
- set the visible of sprite the pArrowRollSprite of gScript to 0
- set the member of sprite the pHiliterSprite of gScript to member ("hmap_" & myContinentCode)
- set the member of sprite the pHeadingSprite of gScript to member ("head_" & myContinentCode)
- set the member of sprite the pTextListSprite of gScript to member ("phlist_" & myContinentCode)
- set the visible of sprite the pHiliterSprite of gScript to 1
- set the visible of sprite the pBackgroundSprite of gScript to 1
- set the visible of sprite the pTextListSprite of gScript to 1
- set the visible of sprite the pHeadingSprite of gScript to 1
- clickedOnFieldLIne(myContinentCode, 1)
- end
-
- on clickedOnFieldLIne myContinentCode, myLineNum
- set tField to the member of sprite the pTextListSprite of gScript
- set tLineNum to max(min(the number of lines in field tField, myLineNum), 1)
- set the member of sprite the pPhoneDisplaySprite of gScript to member ("ph_" & myContinentCode & tLineNum)
- set the visible of sprite the pPhoneDisplaySprite of gScript to 1
- if myLineNum = 1 then
- set the loc of sprite the pArrowSprite of gScript to point(562, 104)
- else
- set the loc of sprite the pArrowSprite of gScript to the loc of sprite the pArrowRollSprite of gScript
- end if
- set the visible of sprite the pArrowSprite of gScript to 1
- end
-
- on rolloverField
- if rollOver(the pTextListSprite of gScript) then
- set tMouseLine to the mouseLine
- if tMouseLine > 0 then
- set tTextSprite to the pTextListSprite of gScript
- set tFieldLocH to the locH of sprite tTextSprite
- set tFieldLocV to the locV of sprite tTextSprite
- set tLineHeight to the textHeight of member the member of sprite tTextSprite
- set the locH of sprite the pArrowSprite of gScript to tFieldLocH - 2
- set the locH of sprite the pArrowRollSprite of gScript to tFieldLocH - 2
- set the locV of sprite 15 to tFieldLocV + (tLineHeight / 2) + (tLineHeight * (tMouseLine - 1))
- set the visible of sprite the pArrowRollSprite of gScript to 1
- end if
- else
- set the visible of sprite the pArrowRollSprite of gScript to 0
- end if
- end
-
- on puppetAllSprites myBoolean
- repeat with i = 1 to 48
- set the puppet of sprite i to myBoolean
- end repeat
- end
-
- on wait myWaitTicks
- set tEndTicks to the ticks + myWaitTicks
- repeat while tEndTicks > the ticks
- nothing()
- end repeat
- end
-